home *** CD-ROM | disk | FTP | other *** search
- on keyDown
- global turn
- set turn to 1
- end
-
- on key
- global exact, up, right, offset, turn, bulletlist, player_acc, direction, max_bullets, bullets_speed
- set turn to 0
- if (the key = "/") or (the keyCode = 124) then
- set direction to direction - 1
- if direction = 0 then
- set direction to exact
- end if
- set the castNum of sprite 10 to direction + offset - 1
- end if
- if (the key = ",") or (the keyCode = 123) then
- set direction to direction + 1
- if direction = (exact + 1) then
- set direction to 1
- end if
- set the castNum of sprite 10 to direction + offset - 1
- end if
- if (the key = "l") or (the key = ";") or (the keyCode = 126) then
- set right to right + (cos(direction * PI / (exact / 2)) * player_acc)
- set up to up + (sin(direction * PI / (exact / 2)) * player_acc)
- if (direction = 6) or (direction = 18) then
- set right to right - cos(direction * PI / (exact / 2))
- end if
- if (direction = 12) or (direction = 24) then
- set up to up - sin(direction * PI / (exact / 2))
- end if
- end if
- if (the key = ".") or (the key = "z") or (the keyCode = 49) then
- set bulletup to sin(direction * PI / (exact / 2)) * bullets_speed
- set bulletright to cos(direction * PI / (exact / 2)) * bullets_speed
- if exact = 24 then
- if (direction = 6) or (direction = 18) then
- set bulletright to 0
- end if
- if (direction = 12) or (direction = 24) then
- set bulletup to 0
- end if
- end if
- if exact = 8 then
- if direction = 4 then
- set bulletup to 0
- end if
- if direction = 6 then
- set bulletright to 0
- end if
- end if
- repeat with t = 1 to max_bullets
- if getAt(bulletlist, t) = 0 then
- setAt(bulletlist, t, birth(script "fire script", t + 4, bulletup, bulletright))
- return
- end if
- end repeat
- end if
- end
-